<template>
	<view class="content">
		<view class="swiper">
			<view class="swiper-con">
				<uv-swiper :list="list3" indicator indicatorMode="line" circular height="195" radius="8"></uv-swiper>
			</view>
		</view>

		<view class="img-list">
			<view class="img" hover-class="activeM">
				<image src="/static/images/zhongchouxinpin.png" mode="widthFix"></image>
			</view>
			<view class="img" hover-class="activeM">
				<image src="/static/images/jijiangzhongchou.png" mode="widthFix"></image>
			</view>
			<view class="img" hover-class="activeM">
				<image src="/static/images/zhongchoubaokuan.png" mode="widthFix"></image>
			</view>
			<view class="img" hover-class="activeM">
				<image src="/static/images/wangqizhongchou.png" mode="widthFix"></image>
			</view>
		</view>

		<view class="title">
			平台推荐
		</view>

		<view class="tuijian">
			<scroll-view class="scroll-x" scroll-x show-scrollbar="false">
				<view class="tuijian-item" v-for="(item,index) in 5">
					<image src="/static/images/ceshitupian.png" mode="widthFix"></image>
					<view class="text">
						长治文创—IP潮玩&插画设计长治文创—IP潮玩&插画设计
					</view>
				</view>
			</scroll-view>
		</view>

		<view class="tab">
			<uv-tabs :list="list" @click="clickTab" lineColor="#E90D00"
				:activeStyle="{color: '#000',fontSize:'28rpx',fontWeight:'600'}"
				:inactiveStyle="{color: '#828999',fontSize:'28rpx'}">
				<template v-slot:right>
					<view style="padding-left: 4px;" @tap="toast" hover-class="activeM">
						<uv-icon name="list" size="21" bold></uv-icon>
					</view>
				</template>
			</uv-tabs>
		</view>

		<view class="shop-box">
			<Waterfall :list="goodsList" :columnCount="2" :gap="10">
				<template #default="{ item }">
					<view class="shop-box-item" hover-class="activeM" @click="goDetail(item)">
						<view class="img">
							<image :src="item.image" mode="widthFix"></image>
						</view>

						<view class="text1">
							<view class="paimai">
								众筹
							</view>
							泡泡玛特 X 壹橙视觉 labubu和周边泡泡玛特 X 壹橙视觉 labubu和周边
						</view>
						<view class="text2">
							<view class="text2-l">
								<view class="jindu">
									<view class="jindu-cover">
										<view class="huo">
											<image src="/static/images/zhongchouhuo.png" mode="widthFix"></image>

											<!-- <image src="/static/images/zhongchouhuobao.png" mode="widthFix"></image> -->
										</view>
									</view>
								</view>
							</view>
							<view class="text2-r">
								进度112%
							</view>
						</view>

						<view class="text3">
							1053人支持
						</view>

						<view class="support">
							<view class="support-l">
								<span style="font-weight: 400;font-size: 28rpx;margin-top: 2rpx;">￥</span>69.90
							</view>

							<view class="support-r" hover-class="activeM">
								去支持
							</view>
						</view>
					</view>
				</template>
			</Waterfall>
		</view>
	</view>
</template>

<script setup>
	import Waterfall from '@/components/Waterfall.vue'
	import {
		ref,
		reactive
	} from 'vue'
	import {
		onLoad,
		onShow
	} from '@dcloudio/uni-app'
	import {
		baseUrl,
		http
	} from '@/utils/request'
	import emitter from '@/utils/emitter.js'
	import {
		showMsg
	} from '@/utils/showMsg'
	const list3 = ref([
		'https://picsum.photos/id/1011/600/800', 'https://picsum.photos/id/1012/600/800',
		'https://picsum.photos/id/1013/600/800'
	])

	const list = ref([{
		id: 1,
		name: '全部',
	}, {
		id: 2,
		name: '玩偶',
	}, {
		id: 3,
		name: '手办'
	}, {
		id: 4,
		name: '文创'
	}, {
		id: 5,
		name: '动漫'
	}, {
		id: 6,
		name: '游戏'
	}, {
		id: 7,
		name: '科技'
	}])

	const clickTab = (item) => {
		console.log(item);
	}

	const goodsList = ref([{
			image: 'https://picsum.photos/id/1011/200/300',
		},
		{
			image: 'https://picsum.photos/id/1012/200/400',
		},
		{
			image: 'https://picsum.photos/id/1013/200/500',
		},
		{
			image: 'https://picsum.photos/id/1014/200/350',
		},
		{
			image: 'https://picsum.photos/id/1015/200/450',
		},
		{
			image: 'https://picsum.photos/id/1016/200/600',
		},
	])
	
	const toast = () => {
		uni.navigateTo({
			url:'/subpackages/home/zcFl'
		})
	}
	
	const goDetail = (item) => {
		uni.navigateTo({
			url:'/subpackages/home/zcDetail'
		})
	}
</script>

<style lang="scss" scoped>
	.swiper {
		width: 100%;
		padding: 0rpx 30rpx;

		.swiper-con {
			width: 100%;
			height: 390rpx;
		}
	}

	.img-list {
		width: 100%;
		margin-top: 30rpx;
		display: flex;
		justify-content: space-around;
		padding: 0rpx 20rpx;

		.img {
			image {
				width: 156rpx !important;
				height: 194rpx !important;
			}
		}

	}

	.title {
		width: 100%;
		padding: 0rpx 30rpx;
		font-weight: bold;
		font-size: 32rpx;
		color: #000000;
		margin-top: 36rpx;
	}

	.tuijian {
		width: 100%;
		margin-top: 20rpx;
		padding: 0rpx 30rpx;

		.scroll-x {
			width: 100%;
			white-space: nowrap;

			.tuijian-item {
				display: inline-block;
				width: 500rpx;
				margin-right: 20rpx;

				image {
					width: 100% !important;
					height: 260rpx !important;
				}

				.text {
					width: 100%;
					overflow: hidden;
					text-overflow: ellipsis;
					white-space: nowrap;
					font-weight: 400;
					font-size: 28rpx;
					color: #182033;
					margin-top: 10rpx;
				}
			}
		}
	}

	.tab {
		width: 100%;
		padding: 0rpx 30rpx;
		margin-top: 30rpx;
	}

	.shop-box {
		width: 100%;
		margin-top: 30rpx;
		padding: 0rpx 30rpx;

		.shop-box-item {
			box-shadow: 0 0 4px rgba(0, 0, 0, 0.1);
			padding-bottom: 10rpx;
			border-radius: 0rpx 0rpx 8rpx 8rpx;

			.img {
				position: relative;
				width: 100%;

				image {
					width: 100% !important;
					// height: 400rpx !important;
					border-radius: 8rpx 8rpx 8rpx 8rpx !important;
				}
			}


			.text1 {
				display: flex;
				align-items: center;
				width: 100%;
				margin: 20rpx 0rpx;
				overflow: hidden;
				text-overflow: ellipsis;
				display: -webkit-box;
				-webkit-box-orient: vertical;
				-webkit-line-clamp: 2;
				font-weight: 600;
				font-size: 30rpx;
				color: #000000;
				padding: 0rpx 10rpx;

				.paimai {
					float: left;
					width: 60rpx;
					height: 36rpx;
					background: #182033;
					border-radius: 8rpx 8rpx 8rpx 8rpx;
					display: flex;
					align-items: center;
					justify-content: center;
					font-size: 20rpx;
					color: #FFF7ED;
					margin-right: 10rpx;
				}
			}

			.price {
				width: 100%;
				margin-bottom: 20rpx;
				font-weight: 600;
				font-size: 28rpx;
				color: #E90D00;
				padding: 0rpx 10rpx;
			}

			.text2 {
				width: 100%;
				display: flex;
				align-items: center;
				padding: 0rpx 10rpx;

				.text2-l {
					width: 70%;

					.jindu {
						position: relative;
						width: 80%;
						height: 16rpx;
						background: #E6E9F0;
						border-radius: 8rpx;

						.jindu-cover {
							position: absolute;
							left: 0;
							top: 0;
							width: 50%;
							height: 16rpx;
							background: linear-gradient(270deg, #EB271D 0%, #EDAAA6 100%);
							border-radius: 8rpx;

							.huo {
								position: absolute;
								right: -16rpx;
								top: -16rpx;

								image {
									width: 32rpx !important;
									height: 40rpx !important;
								}
							}
						}
					}
				}

				.text2-r {
					width: 30%;
					font-weight: 400;
					font-size: 20rpx;
					color: #E90D00;
				}
			}

			.text3 {
				width: 100%;
				font-weight: 400;
				font-size: 20rpx;
				color: #9095A8;
				margin-top: 10rpx;
				padding: 0rpx 10rpx;
			}

			.support {
				width: 100%;
				padding: 0rpx 10rpx;
				display: flex;
				align-items: center;

				.support-l {
					width: calc(100% - 140rpx);
					padding-right: 10rpx;
					font-weight: 600;
					font-size: 32rpx;
					color: #E90D00;
				}

				.support-r {
					width: 140rpx;
					height: 48rpx;
					background: #E90D00;
					border-radius: 24rpx;
					display: flex;
					align-items: center;
					justify-content: center;
					font-size: 28rpx;
					color: #FFFFFF;
				}
			}
		}
	}
</style>